import request from '@/utils/request'
// 区域列表
export const areaList = ({ name, pageIndex, pageSize }) => {
  return request({
    url: '/api/vm-service/region/search',
    params: {
      name, pageIndex, pageSize
    }
  })
}
// 新增区域
export const addZone = (data) => {
  return request({
    url: '/api/vm-service/region',
    method: 'POST',
    data
  })
}
// 获取区域详情
export const zoneDetails = (regionId) => {
  return request({
    url: `/api/vm-service/region/${regionId}`
  })
}

// 修改区域
export const modifyArea = (id, { regionName, remark }) => {
  return request({
    url: `/api/vm-service/region/${id}`,
    method: 'PUT',
    data: {
      regionName, remark
    }
  })
}
// 删除区域
export const delZone = (id) => {
  return request({
    url: `/api/vm-service/region/${id}`,
    method: 'DELETE'
  })
}
